﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;
using System.Web;

namespace WS.EKA.Utilities
{
    public class XmlSerlizer
    {
        public static T Deserialize<T>(string filePath) where T : class
        {
            XmlSerializer serlizer = new XmlSerializer(typeof(T));
            T t = default(T);
            using (FileStream file = File.Open(filePath, FileMode.Open))
            {
                t = serlizer.Deserialize(file) as T;
            }
            return t;
        }

        //public static string SettingFilePath
        //{
        //    get
        //    {
        //        return (@"D:\Codeplex\mobileshop\Src\WS.EKA.Portal\ShopSetting.xml");
        //    }
        //}
    }
}
